package dbTest;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class ConnectionTest
{
	  public static void main(String[] args) 
	  {  
	     Connection connection = null;  
	     ResultSet resultSet = null;  
	     Statement statement = null;  

	     try 
	     {  
	         Class.forName("org.sqlite.JDBC");  
	         connection = DriverManager.getConnection("jdbc:sqlite:C:\\Documents\\Hyppocartes");  
	         statement = connection.createStatement();  
	         resultSet = statement  
	                 .executeQuery("SELECT colorindex FROM stars");  
	         while (resultSet.next()) 
	         {  
	             System.out.println("EMPLOYEE NAME:"  
	                     + resultSet.getString("colorindex"));  
	         }  
	     } 
	     catch (Exception e) 
	     {  
	         e.printStackTrace();  
	     }
	     finally 
	     {  
	         try 
	         {  
	             resultSet.close();  
	             statement.close();  
	             connection.close();  
	         } 
	         catch (Exception e) 
	         {  
	             e.printStackTrace();  
	         }  
	     }  
	 }  
	} 
